FROM java:8

# 环境变量
ENV WORK_PATH /app
ENV APP_NAME target/*.jar
ENV JAVA_OPTS -Xmx512m -Xss256k

EXPOSE 8080

#VOLUME
VOLUME ["/home/project", "/tmp/data"]

#ADD

#COPY
COPY $APP_NAME $WORK_PATH/boot.jar

# WORKDIR
WORKDIR $WORK_PATH

#GMT+8
RUN /bin/cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo "Asia/Shanghai" > /etc/timezone

# ENTRYPOINT
ENTRYPOINT exec java $JAVA_OPTS -jar -Djava.security.egd=file:/dev/./urandom -jar boot.jar